// http://www.cnblogs.com/kuikui/p/3505768.html
var doT = require('#/doT/doT')

console.log(doT);

// $('#interpolation')
var dataInter = { "name": "Jake", "age": 31 };
var interText = doT.template($("#interpolationtmpl").text());
$("#interpolation").html(interText(dataInter));


var dataEval = { "name": "Jake", "age": 31, "interests": ["basketball", "hockey", "photography"], "contact": { "email": "jake@xyz.com", "phone": "999999999" } };
var evalText = doT.template($("#evaluationtmpl").text());
$("#evaluation").html(evalText(dataEval));


var dataArr = { "array": ["banana", "apple", "orange"] };
var arrText = doT.template($("#arraystmpl").text());
$("#arrays").html(arrText(dataArr));


var dataEncode = { "uri": "http://bebedo.com/?keywords=Yoga", "html": "<div style='background: #f00; height: 30px; line-height: 30px;'>html元素</div>" };
var EncodeText = doT.template($("#encodetmpl").text());
$("#encode").html(EncodeText(dataEncode));

var dataCondition = { "uri": "http://bebedo.com/?keywords=Yoga", "html": "<div style='background: #f00; height: 30px; line-height: 30px;'>html元素</div>" };
var ConditionText = doT.template($("#conditionstmpl").text());
$("#condition").html(ConditionText(dataCondition));


var dataPart = {"name":"Jake","age":31,"html":"<div style='background: #f00; height: 30px; line-height: 30px;'>html元素</div>"};
var defPart = {"joke":"<div>{{=it.name}} who?</div>"};
var partText = doT.template($("#parttmpl").text(), undefined, defPart);
$("#part").html(partText(dataPart));